home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 October / CHIP Ekim 1996.iso / winbatch / dirbrows.wb_ < prev    next >
Text File  |  1994-09-25  |  2KB  |  51 lines

  1. gosub BrowseDir
  2. Message("Selected Directory",Directory)
  3. exit
  4.  
  5.  
  6. ;******************************************************************************
  7. ;
  8. ;                                  BROWSEDIR
  9. ;  Generates a directory browsebox with two pushbuttons, SELECT & CANCEL.
  10. ;
  11. ;  Calling Sequence:
  12. ;  Directory = Name of directory to display first (DEFAULT = "c:\")
  13. ;  gosub BrowseDir
  14. ;
  15. ;  Output Parameters:
  16. ;  Directory - lowercase directory name selected. NULL if CANCEL pressed.
  17. ;
  18. ;  Notes:
  19. ;  This subroutine can be used in conjunction with GetDir or by itself.  Since
  20. ;  the dialog box does not return a real filename, the IntControl(4,0,0,0,0)
  21. ;  function must be used.  See WIL Reference manual.
  22. ;
  23. ;******************************************************************************
  24.  
  25.   :BrowseDir
  26.  
  27.     if !IsDefined(Directory) then Directory="c:\"
  28.     DirChange(Directory)
  29.     DefDir="[*]"
  30.     IntControl(4,0,0,0,0)
  31.  
  32.     BrowseDirFormat=`WWWDLGED,4.0`
  33.     BrowseDirCaption="Directory Browse"
  34.     BrowseDirX=2000
  35.     BrowseDirY=2000
  36.     BrowseDirWidth=140
  37.     BrowseDirHeight=108
  38.     BrowseDirNumControls=5
  39.     BrowseDir01=`60,10,70,74,FILELISTBOX,DefDir,DEFAULT`
  40.     BrowseDir02=`8,16,40,DEFAULT,PUSHBUTTON,DEFAULT,"&Select",2`
  41.     BrowseDir03=`8,40,40,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",1`
  42.     BrowseDir04=`14,90,42,DEFAULT,STATICTEXT,DEFAULT,"Selected:"`
  43.     BrowseDir05=`64,90,68,DEFAULT,VARYTEXT,DefDir,""`
  44.     Button=Dialog("BrowseDir")
  45.  
  46.     if Button==1 then Directory=""
  47.                  else Directory=StrLower(DirGet())
  48.  
  49.     IntControl(4,1,0,0,0)
  50.     Return
  51.